<?php
/*
* Yii extension implementing Jquery JSON
*
*  This widget is a wrapper for the above extention
*
* @package Jquery JSON
* @author Loo
* @version 0.1
* @filesource JqueryJson.php
*
*/
class JqueryJson extends CWidget {
    private $_html;
    private $_baseUrl;

  /**
   * Execute the widget
   */
  public function run() {
    $this->registerClientScripts();
    //$this->createMarkup();
  }

  /**
   * Registers the clientside widget files (css & js and other files)
   */
  public function registerClientScripts() {
  // Get the resources path
    $resources = dirname(__FILE__).DIRECTORY_SEPARATOR.'resources';
    // publish the files
    $this->_baseUrl = Yii::app()->assetManager->publish($resources);
    Yii::app()->clientScript->registerScriptFile($this->_baseUrl.'/jquery.json-2.2.min.js');
    Yii::app()->clientScript->registerCssFile($this->_baseUrl.'/list.css');
  }

  /**
   * Creates the html markup needed by the widget
   */
    public function createMarkUp() {
        Yii::app()->clientScript->registerScript('NicEdit',
                "$(function(){ $(\"label\").inFieldLabels(); });;"
                , CClientScript::POS_END);
    }




}
?>
